package Concurrency.future;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.FutureTask;

public class Main {



    public static void main(String[] args) throws ExecutionException, InterruptedException {


        FutureTask<String> futureTask = new FutureTask<String>(new RealData());
        ExecutorService executorService = Executors.newFixedThreadPool(1);
        executorService.submit(futureTask);

        Thread.sleep(500);
        System.out.println(futureTask.get());

    }
}
